.SUFFIXES: .class .java

target=fxanarun

src=fxana/*.java mathwork/*.java
class=fxana/fxana.class

INSTALL_DIR=~/bin


all:$(target).jar

Manifest.txt:
	echo "Manifest-Version: 1.0" >Manifest.txt
	echo "Class-Path: . $(JFREECHARTPATH)/lib/jcommon-1.0.16.jar $(JFREECHARTPATH)/lib/jfreechart-1.0.13.jar" >>Manifest.txt
	echo "Main-Class: fxana.fxana" >>Manifest.txt

$(target).jar: Manifest.txt $(class) 
	jar -cfm $(target).jar Manifest.txt fxana/*.class  mathwork/*.class
	chmod +x $(target).jar
	mv $(target).jar fxana
	-rm fxana/*.class

install:
	((test ! -e fxana/$(target).jar) && (make $(target).jar))||(cp fxana/$(target).jar $(INSTALL_DIR)/)

uninstall:
	-rm  $(INSTALL_DIR)/$(target).jar

$(class): $(src) 
	javac $(src)

clean:
	-rm -f $(target).jar fxana/$(target).jar fxana/*.class mathwork/*.class 2>/dev/null
